Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed alpha from base class #35

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Conversation

jo-mueller
Copy link
Contributor

@jo-mueller jo-mueller commented Aug 8, 2024

Fixes #31 #34

Hi @zoccoler ,

I changed this PR to fix a number of mutually depending issues. The key change is that I added a check to the data setter method. The plot is now redrawn unless the shape/length of the passed data has changed. If the size of the data is the same as before, then only the point properties (alpha, size, color_indices) are kept.

This invalidates the feature of adding new data but I believe it is worth. From the clusters-plotter perspective it makes a lot of sense: Changing the columns of a feature table would correspond to passing new xy values with the same shape - in this case you'd want to keep the other properties (coloring, etc). Adding data of a different shape would correspond to selecting data from a different layer, in which case the coloring and other properties of the previous plot wouldn't make any sense any more, any more and should be reset.

I added some steps to the documentation notebook that hopefully illustrate the concept. The changes also only concern the scatter artist so I am hoping that it would keep other functionality (e.g., of the histogram) untouched

@jo-mueller jo-mueller added the bug Something isn't working label Aug 8, 2024
Copy link

codecov bot commented Aug 8, 2024

Codecov Report

Attention: Patch coverage is 84.84848% with 5 lines in your changes missing coverage. Please review.

Project coverage is 90.52%. Comparing base (41f58dd) to head (651edfa).

Files Patch % Lines
src/biaplotter/artists.py 81.48% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
- Coverage   90.77%   90.52%   -0.26%     
==========================================
  Files           7        7              
  Lines         629      644      +15     
==========================================
+ Hits          571      583      +12     
- Misses         58       61       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@zoccoler
Copy link
Contributor

zoccoler commented Aug 9, 2024

Awesome! Would you mind just adding one test and updating the documentation with the alpha property?
I think those are the last things needed to merge.

@jo-mueller
Copy link
Contributor Author

@zoccoler actually - I am just realizing that the relevant change is missing on this branch (I am so confused), but I also don't manage to implement it properly. I keep getting errors due to color_indeces, alpha and size being out of sync (maybe related to #34).

The problem is that, if color indeces is updated before alpha is updated, then the color values don't match the number of alpha values any more and vice versa. I think we may have to think about this problem a bit more before moving on with the implementation 🤔

@jo-mueller
Copy link
Contributor Author

@zoccoler - changed the PR description and content (see description on top)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check if set alpha property is working
2 participants